Improve Playwright browser provisioning guidance - #58791
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| browsers: [chromium, firefox, webkit] | ||
| ``` | ||
|
|
||
| Supported values are `chrome`, `chromium`, `firefox`, and `webkit`. Do not add |
There was a problem hiding this comment.
@copilot there is a chrome-for-test distribution, search the full list
There was a problem hiding this comment.
Added chrome-for-testing as a supported browsers alias and documented that Playwright's chromium target installs the Chrome for Testing distribution. I also checked the pinned Playwright CLI's full install-target list and kept system channels/platform-specific tools out of this portable engine field. Addressed in fbc34c0.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The matcher misses valid npx -y and bun x browser-install commands.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Improves compiler-managed Playwright browser provisioning guidance and warns about redundant installation steps.
Changes:
- Adds browser-install command detection across custom step phases.
- Adds
chrome-for-testingas a Chromium alias. - Updates tests, documentation, schema, and release notes.
File summaries
| File | Description |
|---|---|
pkg/workflow/playwright_validation.go |
Adds alias validation and install warnings. |
pkg/workflow/playwright_validation_test.go |
Tests warnings and compilation. |
pkg/workflow/playwright_cli_test.go |
Tests alias normalization. |
pkg/workflow/compiler_validators.go |
Invokes the new warning. |
pkg/parser/schemas/main_workflow_schema.json |
Adds the browser alias. |
docs/src/content/docs/reference/playwright.md |
Documents browser provisioning. |
docs/src/content/docs/reference/frontmatter-full.md |
Updates generated field guidance. |
.github/aw/playwright.md |
Expands authoring guidance. |
.changeset/improve-playwright-browser-guidance.md |
Records the patch change. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| "github.com/goccy/go-yaml" | ||
| ) | ||
|
|
||
| var playwrightBrowserInstallPattern = regexp.MustCompile(`(?im)(?:^|&&|\|\||;)[ \t]*(?:(?:npx|npm[ \t]+(?:exec|x)|pnpm[ \t]+(?:exec|dlx)|yarn(?:[ \t]+(?:exec|dlx))?|bunx)[ \t]+(?:(?:--yes|--no-install|--)[ \t]+)*)?playwright(?:@[^\s;&|]+)?[ \t]+install(?:[ \t]|$)`) |
|
🎉 This pull request is included in a new release. Release: |
Playwright workflows can redundantly install browser engines instead of using the compiler-managed
browsersfield. This adds clearer guidance and detects unnecessary installation steps.Guidance
Compiler
tools.playwright.browsers.Coverage